Skip to content

feat: create metadata entries generator #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

araujogui
Copy link
Member

Description

Creates metadata entries generator

Related Issues

Fixes #271

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@araujogui araujogui changed the title Refactor parsers feat: create metadata entries generator May 14, 2025
@araujogui
Copy link
Member Author

araujogui commented May 15, 2025

Blocking this until #275 is merged.

@araujogui araujogui marked this pull request as ready for review May 22, 2025 16:44
@araujogui araujogui requested a review from a team as a code owner May 22, 2025 16:44
@ovflowd
Copy link
Member

ovflowd commented May 23, 2025

@araujogui I saw there is a blocked label, could you elaborate what's blocked?

@araujogui
Copy link
Member Author

@araujogui I saw there is a blocked label, could you elaborate what's blocked?

The current linter relies on metadata entries, which are no longer easily available because it's now a generator. I’ve blocked this until #275 is merged, as it removes the linter's dependency on metadata.

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.88%. Comparing base (37c3202) to head (5a53252).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #272   +/-   ##
=======================================
  Coverage   91.88%   91.88%           
=======================================
  Files          56       56           
  Lines        4142     4142           
  Branches      174      174           
=======================================
  Hits         3806     3806           
  Misses        334      334           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@araujogui araujogui removed the blocked label May 28, 2025
@araujogui
Copy link
Member Author

@nodejs/web-infra this is ready for reviews

@@ -109,7 +109,7 @@ const createMetadata = slugger => {
* The Navigation entries has a dedicated separate method for retrieval
* as it can be manipulated outside of the scope of the generation of the content
*
* @param {import('vfile').VFile} apiDoc The API doc file being parsed
* @param {{stem?: string, basename?: string}} apiDoc The API doc file being parsed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this still a VFile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it is but some properties like stem and basename are not enumerable in VFile, so I needed to serialize them before sending to worker threads.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can create a PR on the VFile repo to mark these as enumerable, but I'm not sure if there are any drawbacks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, but let's see what others think, we should use the VFile type when possible, since we have it.

Comment on lines +37 to +43
return {
file: {
stem: resolvedApiDoc.stem,
basename: resolvedApiDoc.basename,
},
tree: apiDocTree,
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use VFile?

Comment on lines +12 to +19
export interface ParserOutput<T> {
file: {
stem?: string;
basename?: string;
};
tree: T;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VFile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create metadata entries generator
4 participants